<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/MotaSiteStandard.Master" Inherits="System.Web.Mvc.ViewPage<MotaWeb.Models.Announcement>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	MoTA - Edit Announcement
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <script type="text/javascript">
        $("#EffectiveDate").datepicker();
        $("#ExpirationDate").datepicker(); 
    </script>  

    <script type="text/javascript">
        $(document).ready(function() {
        $("#EffectiveDate").datepicker();
        $("#ExpirationDate").datepicker();
        });
    </script>

    <%= Html.ValidationSummary("Edit was unsuccessful. Please correct the errors and try again.") %>

    <% using (Html.BeginForm()) {%>

        <fieldset id="announcementFields">
            <legend>Announcement Details</legend>
            <p>
                <label for="Message">Message:</label>
                <%= Html.TextArea("Message") %>
                <%= Html.ValidationMessage("Message", "*") %>
            </p>
            <p>
                <label for="EffectiveDate">Effective Date: (click to select)</label>
                <%= Html.DatePicker("EffectiveDate", string.Format("{0:d}", Model.EffectiveDate)) %>
                <%= Html.ValidationMessage("EffectiveDate", "*") %>
            </p>
            <p>
                <label for="ExpirationDate">Expiration Date: (click to select)</label>
                <%= Html.DatePicker("ExpirationDate", string.Format("{0:d}", Model.ExpirationDate)) %>
                <%= Html.ValidationMessage("ExpirationDate", "*") %>
            </p>
            <p>
                <input type="submit" value="Save" />
            </p>
        </fieldset>

    <% } %>

    <div>
        <%=Html.ActionLink("Back to List", "Index") %>
    </div>

</asp:Content>

